<template>
  <div @click="clickMe">
    我是A组件, flag = {{ flag }}
  </div>
  <button @click="add">改变count</button>
  <div>{{ count }}</div>
</template>

<script setup lang="ts">
import { ref, getCurrentInstance, useAttrs, watch } from 'vue';
import { $ref, $$ } from 'vue/macros'
// import Bus from './Bus'

const instance = getCurrentInstance()
let flag = ref(false);
const clickMe = () => {
  flag.value = !flag.value;
  instance?.proxy?.$Bus.emit("on-click", flag);
}
console.log(useAttrs())

let count = $ref<number>(0)
const add = () => {
  count++
}

watch($$(count), (v) => {
  console.log(v)
})
console.log(import.meta.env)
</script>

<style scoped>

</style>